﻿using System;
using System.Threading.Tasks;

namespace suamod.fuwu
{
    using oueb.Ceen;
    public class SuaModule : IHttpModule
    {
        public Task<bool> HandleAsync(IHttpContext context)
        {
            switch (context.Request.Method)
            {
                case "OPTIONS": 
                    context.Response.StatusCode = HttpStatusCode.NoContent;
                    context.Response.AddHeader("Allow", "OPTIONS, GET, POST");
                    return Task.FromResult(true);
            }
            return Task.FromResult(false);
        }
    }
}
